import { inject, injectable } from 'inversify';
import { APIClient, HttpMethod } from '@todo/core';

import { responseUserProfileDTO } from './user.dto.ts';
import { EUserEndpoints } from '../config/endpoints.ts';

@injectable()
export class UserRepository {
  constructor(
    @inject(APIClient)
    private apiClient: APIClient,
  ) {}

  async getProfile(): Promise<responseUserProfileDTO> {
    return await this.apiClient.request<null, responseUserProfileDTO>({
      route: EUserEndpoints.GET_PROFILE,
      method: HttpMethod.GET,
    });
  }
}
